package com.cjm.one.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.result.Result;
import com.cjm.one.model.order.dto.OrderOperateDTO;
import com.cjm.one.model.order.dto.OrderStatusDto;
import com.cjm.one.model.order.enums.OrderParamsTypeEnum;
import com.cjm.one.model.order.enums.OrderStatusEnum;
import com.cjm.one.model.order.vo.OrderInfoVo;
import com.cjm.one.order.client.OrderInfoClient;
import com.cjm.one.service.OrderInfoService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class OrderInfoServiceImpl implements OrderInfoService {
    @Resource
    private OrderInfoClient orderInfoClient;

    @Override
    public Result<Page<OrderInfoVo>>list(Long current, Long size, OrderParamsTypeEnum type) {
        return orderInfoClient.list(current, size, type);

    }

    @Override
    public Result<String> add(OrderOperateDTO orderOperateDTO) {
        return orderInfoClient.add(orderOperateDTO);
    }

    @Override
    public Result<Boolean> updateById(OrderInfoVo orderInfoVo) {
        return orderInfoClient.update(orderInfoVo);
    }

    @Override
    public Result<Boolean> removeById(Long id) {
        return orderInfoClient.appdelete(id);
    }

    @Override
    public Result<OrderInfoVo> getAppUserByOrderId(Long id) {
        return orderInfoClient.getAppUserByOrderId(id);
    }

    @Override
    public Result<Boolean> updateOrderStatusById(OrderStatusDto orderStatusDto) {
        return orderInfoClient.updateOrderStatus(orderStatusDto);
    }
}
